package pl.qsoft.db.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation interface for describing stored procedure parameters
 * @author Wojciech Kudla
 */

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER})
public @interface StoredProcedureParam {
	
	/**
	 * Enum for describing parameter kind: IN, OUT or INOUT
	 * @author Wojciech Kudla
	 */
	public enum ParamKind {IN, OUT, INOUT}
	
	/**
	 * Enum describing most common database types. Chosen value influences mapping to a specific database type given a database vendor
	 * @author Wojciech Kudla
	 */
	public enum VariableType {VARCHAR, CURSOR, NUMBER, DATE, TIMESTAMP, DATETIME, BLOB, CLOB}
	
	/**
	 * The index of the specified parameter in the stored procedure signature 
	 */
	int paramNumber() default -1;
	
	/**
	 * The parameter name of the specified parameter in the stored procedure signature 
	 */
	String paramName() default "";
	
	/**
	 * Parameter kind
	 * @see ParamKind 
	 */
	ParamKind paramKind() default ParamKind.IN;
	
	/**
	 * Declared parameter database type 
	 * @see VariableType
	 */
	VariableType variableType() default VariableType.VARCHAR;

}
